package com.itheima.dao;

import com.itheima.util.SessionFactoryUtils;
import org.apache.ibatis.session.SqlSession;

public class UserDao {
    //dao层
    public static UserMapper getSqlSession() {
        //获得会话对象
        SqlSession sqlSession = SessionFactoryUtils.getSession();

        //通过getmapper方法拿到代理类对象
        UserMapper userMapper = sqlSession.getMapper(UserMapper.class);

        //返回代理类对象
        return userMapper;

    }
}
